#ifndef CONSUMERTHREAD_H
#define CONSUMERTHREAD_H

#include <QThread>
#include <QMutex>

class ConsumerThread : public QThread
{
    Q_OBJECT
public:
    explicit ConsumerThread(QObject *parent = nullptr);
    void stop();

public slots:
    void handleData(int value);  // 处理数据的槽函数

signals:
    void resultReady(QString result);  // 处理结果信号

protected:
    void run() override;

private:
    bool m_stopped;
    QMutex m_mutex;
};

#endif // CONSUMERTHREAD_H
